package com.student.health.config;

import com.student.health.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: XXX
 * @Date: 2024-04-03 16:58
 * @Description:
 * @Version 1.0
 */
@Component
public class NotifyTask {

    @Autowired
    private UserService userService;

    @Scheduled(cron = "0 0 7 * * ?")
    public void breakNotifyTask(){
        userService.userNotify("早餐");
    }
    @Scheduled(cron = "0 0 12 * * ?")
    public void lunchNotifyTask(){
        userService.userNotify("午餐");
    }
    @Scheduled(cron = "0 0 18 * * ?")
    public void dinnerNotifyTask(){
        userService.userNotify("晚餐");
    }
}
